package com.arvato.admin01.controller.wx;

import com.arvato.admin01.config.WxGlobalInfoConfig;
import com.arvato.admin01.constant.ServerResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.arvato.admin01.constant.ResponseCode.ILLEGAL_ARGUMENT;

/**
 * @author xu yuanjun
 * @data 2020/4/8 10:00
 */
@Slf4j
@RestController
@RequestMapping("/login")
public class LoginController {

 @Autowired
 private WxGlobalInfoConfig wxGlobalInfoConfig;

 /**
  * 获取 session_key
  * @param code
  * @return
  */
 public ServerResponse getUser(String code){
     log.info("code>>>>>>>>"+code);
     if(StringUtils.isBlank(code)){
      return ServerResponse.error(ILLEGAL_ARGUMENT.getMsg());
     }
     String appid = wxGlobalInfoConfig.getAppId();
     String secret =  wxGlobalInfoConfig.getSecret();

     return ServerResponse.success();
 }
}
